﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using OptusMobile.Web.ServerComponents.BAL.Authentication;

namespace OptusMobile
{
    public partial class _Default : System.Web.UI.Page
    {
        //LoginManager loginManager = new LoginManager();

        protected void Page_Load(object sender, EventArgs e)
        {
            
        }
        private LoginManager loginmanager;

        protected void btLogin_Click(object sender, EventArgs e)
        {
            loginmanager = new LoginManager();
            bool status = loginmanager.UserAuthenticate(this.txbPhone.Text, this.txbPWD.Text);
            if (status == true)
            {
                Session["ID"] = txbPhone.Text;
                Session["password"] = txbPWD.Text;
                Session["flag"] = "user";
                this.Response.Redirect("CustomerPortal/CustomerHome.aspx");
            }
            else
            {
                ErrMessage.Visible = true;
                ErrMessage.Text = "Mobile or Password is incorrect";
                txbPhone.Text = "";
                txbPWD.Text = "";
            }


            //Response.Redirect("Handset/AllHandsetShow.aspx");
        }

  

 
        

      
        //protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
        //{
        //    e.Authenticated = loginManager.(Login1.UserName, Login1.Password);
        //}
    }
}
